<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
 */

Route::get('/', function () {
    return view('index');
});

// 品牌添加
Route::get('brand/brand_add', function () {
    return view('brand/brand_add');
});

// 测试
Route::get('demo','AuthController@demo');

//登录

Route::any('goodsAttribute/show_attribute','GoodsAttributeController@show_attribute')->name('goodsAttribute/show_attribute');
Route::any('goodsAttribute/add_attribute','GoodsAttributeController@add_attribute')->name('goodsAttribute/add_attribute');
Route::any('goodsAttribute/doadd_attribute','GoodsAttributeController@doadd_attribute')->name('goodsAttribute/doadd_attribute');
Route::any('goodsAttribute/attr_value_check','GoodsAttributeController@attr_value_check')->name('goodsAttribute/attr_value_check');
Route::any('goodsAttribute/edit_attribute','GoodsAttributeController@edit_attribute')->name('goodsAttribute/edit_attribute');
Route::any('goodsAttribute/del_attribute','GoodsAttributeController@del_attribute')->name('goodsAttribute/del_attribute');
Route::any('goodsAttribute/attr_value_add','GoodsAttributeController@attr_value_add')->name('goodsAttribute/attr_value_add');
Route::any('goodsAttribute/attr_value_edit','GoodsAttributeController@attr_value_edit')->name('goodsAttribute/attr_value_edit');
Route::any('goodsAttribute/attr_value_del','GoodsAttributeController@attr_value_del')->name('goodsAttribute/attr_value_del');
Route::any('goodsAttribute/static_attribute','GoodsAttributeController@static_attribute')->name('goodsAttribute/static_attribute');      
Route::any('menu/show','MenuController@show')->name('menu/show');


Route::get('demo','AuthController@demo');

Route::prefix('admin')->group(function () {
    Route::get('login', function () {
        return view('auth/login');
    });
    Route::post('login', 'AuthController@store')->name('login');
    Route::get('logout', 'AuthController@destroy')->name('logout');
});


// 分类

Route::prefix('cate')->group(function () {
    Route::get('/', function () {
        return view('cate/cate');
    });
    Route::get('cateList', 'CateController@cateList')->name('cateList');
    Route::post('cateDel', 'CateController@destroy')->name('cateDel');
    Route::post('addTop', 'CateController@createTop')->name('addTop');
    Route::post('addSon', 'CateController@createSon')->name('addSon');
    Route::post('cateSave', 'CateController@update')->name('cateSave');
});




// 品牌
Route::group(['prefix' => 'brand'], function () {
    Route::get('brand_list', "BrandController@brand_list")->name('brand_list'); //品牌列表
    Route::get('list_data', "BrandController@list_data"); //品牌列表数据
    Route::post('brand_add', "BrandController@brand_add")->name('brand_add'); //品牌添加
    Route::any('upload', "BrandController@upload"); //品牌添加
    Route::get('brand_save', "BrandController@brand_save")->name('brand_save'); //渲染品牌修改页
    Route::post('brand_saves', "BrandController@brand_saves")->name('brand_saves'); //执行品牌修改
    Route::get('brand_del', "BrandController@brand_del"); //品牌删除
});

